<?php


namespace App\Jobs;


use App\Models\OrderCustoms as Model;
use App\Repositories\OrderCustoms as Repositories;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Log;

class OrderCustomsSend
    implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    private $id;

    /**
     * OrderCustomsSend constructor.
     * @param $id
     */
    public function __construct($id)
    {
        $this->id = $id;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        try{
            app(Repositories::class)->sendCustoms($this->id);
        }catch (\Exception | \Throwable $exception){
            Log::error("清关失败:". $exception->getMessage());
        }
    }

}
